package com.ruoyi.business.mapper.wecom;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.business.domain.dto.admin.user.TbUserBabyPageQueryDTO;
import com.ruoyi.business.domain.vo.TbUserBabyPageVO;
import com.ruoyi.business.domain.vo.wecom.admin.TbWecomCustomerChatGroupPageVO;
import com.ruoyi.business.domain.vo.wecom.admin.TbWecomCustomerPageVO;
import com.ruoyi.business.domain.wecom.TbWecomExternalContactCustomer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 企业微信外部联系人客户表 Mapper 接口
 * </p>
 *
 * @author
 * @since 2024-01-18
 */
@Mapper
public interface TbWecomExternalContactCustomerMapper extends BaseMapper<TbWecomExternalContactCustomer> {
    /**
     * 分页查询客户ID列表
     */
    List<String> selectPageCustomerIds(@Param("offset") long offset,
                                       @Param("size") long size,
                                       @Param("userIds") List<String> userIds,
                                       @Param("tagIds") List<String> tagIds,
                                       @Param("addWays") List<String> addWays,
                                       @Param("name") String name,
                                       @Param("externalUserid") String externalUserid,
                                       @Param("gender") Integer gender,
                                       @Param("type") Integer type,
                                       @Param("followStatus") Integer followStatus,
                                       @Param("beginTime") Long beginTime,
                                       @Param("endTime") Long endTime
    );

    /**
     * 查询符合条件的总记录数
     */
    Long selectCountByConditions(@Param("userIds") List<String> userIds,
                                 @Param("tagIds") List<String> tagIds,
                                 @Param("addWays") List<String> addWays,
                                 @Param("name") String name,
                                 @Param("externalUserid") String externalUserid,
                                 @Param("gender") Integer gender,
                                 @Param("type") Integer type,
                                 @Param("followStatus") Integer followStatus,
                                 @Param("beginTime") Long beginTime,
                                 @Param("endTime") Long endTime
    );

    /**
     * 根据客户ID列表查询详情
     */
    List<TbWecomCustomerPageVO> selectCustomerDetailsByIds(@Param("externalUserIds") List<String> externalUserIds);




    IPage<TbWecomCustomerChatGroupPageVO> selectWecomCustomerPageListByChatIds(@Param("page") Page<TbWecomCustomerChatGroupPageVO> page,
                                                                               @Param("chatIds") List<String> chatIds,
                                                                               @Param("type") Integer type);





}
